class CreateNewsletters < ActiveRecord::Migration
	def self.up
		
		create_table :newsletters do |t|
			t.string :name, :null => false
			t.text :message, :null => false
			t.boolean :sent, :default => false
			t.datetime :sent_at
			t.timestamps
		end
		
		create_table :contacts_newsletters, :id => false do |t|
			t.integer :contact_id, :null => false
			t.integer :newsletter_id, :null => false
		end
		
	end
	
	def self.down
		drop_table :contacts_newsletters
		drop_table :newsletters
	end
end
